import type {CompanyItem} from '../types'
const COMPANYLIST = 'company_list'

const setCompanyList = (list:CompanyItem[])=>{
  const local = JSON.stringify(list)
  localStorage.setItem(COMPANYLIST,local)
}

const getCompanyList = ()=>{
  const loacl = localStorage.getItem(COMPANYLIST)
  if(loacl){
    return JSON.parse(loacl)as CompanyItem[]
  }
}
 
const removeCompanyList = ()=>{
  localStorage.removeItem(COMPANYLIST)
}

export {setCompanyList,getCompanyList,removeCompanyList}